

package plantObjects;

import java.util.ArrayList;
/**
 * Representation of a physical slap (long & short bar) going through the system
 * @author guru
 */
public class Slap {
    // list of all slaps
    static private ArrayList<Slap> allSlaps = new ArrayList<Slap>();

    //slap type
    private String barType;

    public Slap(String barType)
    {
        // assigning barType Value and adding to slap list
        this.barType = barType;
        allSlaps.add(this);
    }

    /**
     * remove a
     * @param sl
     */
    public static void removeSlap(Slap sl)
    {
        allSlaps.remove(sl);
    }
    /**
     * Checks if this slap equals a given type
     * @param String barType
     * @return true / false
     */
    public boolean equals(String type1)
    {
        if(type1.compareTo(barType) == 0) return true;
        else return false;
    }

    public String getType()
    {
        return barType;
    }
}
